package output;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JPanel;


public class Output extends JFrame {

	private ControlPanel2 controlPanel2;
	private Direction direction;
	private OutputPanel outputPanel;
	
	
	public Output (){
		
		/*Finish the program when the user closes the window*/
		this.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		});
		
		/*Instantiate the panels and parameters objects*/



		this.direction      = new Direction();
		this.controlPanel2      = new ControlPanel2();
		this.outputPanel       = new OutputPanel ();

        //instance ops
        OPSInterface opsInt = new OPSInterface();
        opsInt.addObserverOPS(this.controlPanel2,this.direction,this.outputPanel);
		
		/*Set the LayoutManager*/
		this.setLayout(new GridLayout(0, 3));
		
		/*Add the two panel to the JFrame*/
		this.add(controlPanel2);
		this.add(direction);
		this.add(outputPanel);
		
		this.setSize(400, 600);
		
		
		this.pack();
		this.setVisible (true);
		
	}
	
    public static void main(String[] args) {
        Output out = new Output();

    }

}
